package com.oa.co.controller;

import com.github.pagehelper.PageInfo;
import com.oa.co.pojo.UserOa;
import com.oa.co.service.UserOaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/student")
public class UserOaJumpController {

    @Autowired
    private UserOaService studentService;

    // @RequestParam  接受普通参数的注解   defaultValue = "3"  设置页码显示默认是3页
    @RequestMapping("/studentList")
    public String studentList(@RequestParam(defaultValue = "3") Integer pageNum, Integer limit, String sname, Model model){
        PageInfo<UserOa> page = studentService.getPageData(pageNum,limit,sname);
        model.addAttribute("page",page);
        model.addAttribute("s_name",sname);


        return "studentList";
    }

}
